package com.cd.service.science.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.cd.bean.Science;
import com.cd.dao.ScienceMapper;
import com.cd.service.science.ScienceService;

/**
 *科研成果
 *@Author zhk
 *@Date 2017-12-20
 **/
@Service("scienceService")
public class ScienceServiceImpl implements ScienceService{

	@Autowired
	ScienceMapper scienceMapper;

	@Override
	public void save(Science science) throws Exception {
		scienceMapper.save(science);
	}

	@Override
	public void delete(Integer id) throws Exception {
		scienceMapper.delete(id);
	}

	@Override
	public void edit(Science science) throws Exception {
		scienceMapper.update(science);
	}

	@Override
	public List<Science> listAll() throws Exception {
		return scienceMapper.queryByList();
	}

	@Override
	public Science findById(Integer id) throws Exception {
		return scienceMapper.query(id);
	}

	@Override
	public void deleteAll() throws Exception {
		
	}

	@Override
	public Integer size() throws Exception {
		return scienceMapper.getCount();
	}

	@Override
	public List<Science> listLimit() throws Exception {
		
		return scienceMapper.list();
		
	}
	
	
}
